<?php

namespace app\admin\controller;

use think\Controller;


class Common extends Controller{
    
    protected function _initialize()
    {
        // $objRpcClient = FactoryApi::getInstance()->get('RpcClient');
        // $objIlog = $objRpcClient->loadClass('Ilog');
        // $ret1 = $objIlog->asend_saveLog($ilogData);
        // dump('admin-common-_initialize');
    }
    
    public function returnJson($code, $msg, $data = [], $echoAndExit = true)
    {
        $ret = [
            'code' => $code,
            'msg'  => $msg,
            'data' => $data,
        ];
        if ($echoAndExit) {
            exit(json_encode($ret));
        }

        return $ret;
    }
}
